<%--
  Created by IntelliJ IDEA.
  User: 小正
  Date: 2024/11/17
  Time: 下午1:42
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>请假单列表页面</title>
    <style>
        body, html {
            height: 100%;
            margin: 0;
        }

        .container {
            background-image: linear-gradient(to right, rgb(196, 208, 255), rgb(196, 232, 255));
            padding: 20px;
            border-radius: 8px;
            min-height: 100%; /* 使容器至少占据整个视口的高度 */
            min-width: 100%;

            table {
                text-align: center;
            }
        }

        /* 表单容器样式 */
        .search-form-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        /* 输入框样式 */
        .search-input {
            width: 60%;
            padding: 10px;
            margin-bottom: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box; /* 使内边距不影响宽度 */
        }


    </style>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
          integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
            integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
            crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
    <div class="search-form-container">
    </div>
    <table class="table table-striped">
        <thead>
        <tr>
            <th>请假编号</th>
            <th>请假课程</th>
            <th>请假事由</th>
            <th>天数</th>
            <th>学号</th>
            <th>状态</th>
            <th>审核意见</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="leave" items="${leaves}">
            <tr>
                <td>${leave.leaveID}</td>
                <td>${leave.courseID}</td>
                <td>${leave.reason}</td>
                <td>${leave.daynum}</td>
                <td>${leave.stuNo}</td>
                <td><c:choose>
                    <c:when test="${leave.status==1}">
                        <span style="color: #00aa00">同意</span>
                    </c:when>
                    <c:when test="${leave.status==2}">
                        <span style="color: red">不同意</span>
                    </c:when>
                    <c:otherwise>
                        <span style="color: #00d8fd">待审核</span>
                    </c:otherwise>
                </c:choose></td>
                <td>${leave.opinion != null ? leave.opinion : "暂无" }</td>
                <td>
                    <c:if test="${leave.status == 0 }">
                        <a class="btn btn-info" href="/leave?action=viewExamine&leaveID=${leave.leaveID}"
                           role="button">审核</a>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
</body>
</html>
